function IContainerWorkersEdit(container, item, options) {
  this._container = container;
  this._item = item;
  this._options = options;
  
  this._createElements();
};

IContainerWorkersEdit.prototype._createElements = function() {
  var gui, table, tr, td, input, select, option, unique = MiscUtils.unique();
  DOMUtils.removeChildElements(this._container);
  
  var statusTable = document.createElement('table');
  statusTable.style.backgroundImage = 'url(images/common/headline3.png)';
  statusTable.style.backgroundRepeat = 'repeat-x';
  statusTable.style.width = '100%';
  statusTable.style.height = '39px';
  statusTable.cellPadding = 0;
  statusTable.cellSpacing = 0;
  this._container.appendChild(statusTable);
  
  var str = statusTable.insertRow(-1);
  var std = str.insertCell(-1);
  std.style.textAlign = 'right';
  std.style.padding = '0 5px 0 0';
  std.style.verticalAlign = 'middle';
  std.style.width = '85px';
  std.style.height = '39px';
  std.style.fontSize = '12px';
  std.style.fontWeight = 'bold';
  std.style.family = 'Arail';
  std.id = unique + '_pLeft_div';
  
  std = str.insertCell(-1);
  std.style.textAlign = 'left';
  std.style.verticalAlign = 'middle';
  std.style.width = '200px';
  std.style.height = '39px';
  std.style.fontWeight = 'bold';
  std.style.color = '#694247';
  std.style.fontSize = '9pt';
  std.appendChild(document.createTextNode('Unused Photography Hours'));
  
  std = str.insertCell(-1);
  std.style.textAlign = 'right';
  std.style.padding = '0 5px 0 0';
  std.style.verticalAlign = 'middle';
  std.style.width = '65px';
  std.style.height = '39px';
  std.style.fontSize = '12px';
  std.style.fontWeight = 'bold';
  std.style.family = 'Arail';
  std.id = unique + '_vLeft_div';
  
  std = str.insertCell(-1);
  std.style.textAlign = 'left';
  std.style.verticalAlign = 'middle';
  std.style.width = '200px';
  std.style.height = '39px';
  std.style.fontWeight = 'bold';
  std.style.color = '#694247';
  std.style.fontSize = '9pt';
  std.appendChild(document.createTextNode('Unused Videography Hours'));
  
  std = str.insertCell(-1);
  std.style.textAlign = 'right';
  std.style.padding = '0 5px 0 0';
  std.style.verticalAlign = 'middle';
  std.style.width = '65px';
  std.style.height = '39px';
  std.style.fontSize = '12px';
  std.style.fontWeight = 'bold';
  std.style.family = 'Arail';
  std.id = unique + '_travelLeft_div';
  
  std = str.insertCell(-1);
  std.style.textAlign = 'left';
  std.style.verticalAlign = 'middle';
  std.style.width = '180px';
  std.style.height = '39px';
  std.style.fontWeight = 'bold';
  std.style.color = '#694247';
  std.style.fontSize = '9pt';
  std.appendChild(document.createTextNode('Unused Travelling Fee'));
  
  var marginTable = document.createElement('table');
  marginTable.style.height = '5px';
  this._container.appendChild(marginTable);
  
  
  table = document.createElement('table');
  table.style.backgroundColor = '#ebebe3';
  table.style.padding = '10px 0';
  table.style.borderBottom = 'solid 1px #8F8F8A';
  table.style.width = '100%';
  table.style.height = '10px';
  table.cellPadding = 0;
  table.cellSpacing = 0;
  this._container.appendChild(table);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'center';
  var content = document.createElement('table');
  content.style.width = '620px';
  content.cellPadding = 0;
  content.cellSpacing = 0;
  td.appendChild(content);
  
  itr = content.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = '160px';
  itd.style.height = '25px';
  
  itd = itr.insertCell(-1);
  itd.style.width = '100px';
  itd.style.height = '25px';

  itd = itr.insertCell(-1);
  itd.style.width = '120px';
  itd.style.textAlign = 'left';
  itd.style.verticalAlign = 'middle';
  itd.style.fontWeight = 'bold';
  itd.style.color = '#694247';
  itd.style.fontSize = '10pt';
  itd.appendChild(document.createTextNode('Hours'));

  itd = itr.insertCell(-1);
  itd.style.width = '120px';
  itd.style.textAlign = 'left';
  itd.style.verticalAlign = 'middle';
  itd.style.fontWeight = 'bold';
  itd.style.color = '#694247';
  itd.style.fontSize = '10pt';
  itd.appendChild(document.createTextNode('Extra hours'));
  
  itd = itr.insertCell(-1);
  itd.style.width = '120px';
  itd.style.textAlign = 'left';
  itd.style.verticalAlign = 'middle';
  itd.style.fontWeight = 'bold';
  itd.style.color = '#694247';
  itd.style.fontSize = '10pt';
  itd.appendChild(document.createTextNode('Travelling fee'));
  
  for (var i = 0, il = this._item.length; i < il; i++) {
    ctr = content.insertRow(-1);
    ctd = ctr.insertCell(-1);
    ctd.style.height = '30px';
    ctd.style.textAlign = 'left';
    ctd.id = unique + '_' + i + '_title_div';
    
    ctd = ctr.insertCell(-1);
    ctd.style.height = '30px';
    ctd.style.textAlign = 'left';
    ctd.id = unique + '_' + i + '_worker_div';

    ctd = ctr.insertCell(-1);
    input = DOMUtils.createInput(null, null, 'text', '', null);
    input.id = unique + '_' + i + '_estimates_text';
    input.style.width = '40px';
    input.style.height = '18px';
    input.style.borderRight= 'solid 1px #fff';
    input.style.borderBottom=  'solid 1px #fff';
    input.style.borderLeft= 'solid 1px #d2c4b9';
    input.style.borderTop= 'solid 1px #d2c4b9';
    ctd.appendChild(input);
    
    ctd = ctr.insertCell(-1);
    input = DOMUtils.createInput(null, null, 'text', '', null);
    input.id = unique + '_' + i + '_extras_text';
    input.style.width = '40px';
    input.style.height = '18px';
    input.style.borderRight= 'solid 1px #fff';
    input.style.borderBottom=  'solid 1px #fff';
    input.style.borderLeft= 'solid 1px #d2c4b9';
    input.style.borderTop= 'solid 1px #d2c4b9';
    ctd.appendChild(input);
    
    ctd = ctr.insertCell(-1);
    input = DOMUtils.createInput(null, null, 'text', '', null);
    input.id = unique + '_' + i + '_travel_text';
    input.style.width = '80px';
    input.style.height = '18px';
    input.style.borderRight= 'solid 1px #fff';
    input.style.borderBottom=  'solid 1px #fff';
    input.style.borderLeft= 'solid 1px #d2c4b9';
    input.style.borderTop= 'solid 1px #d2c4b9';
    ctd.appendChild(input);
  }

  
  gui = GuiContainerWorkersEdit.instance(unique, this._item);
  new HandleContainerWorkersEdit(gui, this._item, this._options);
};